It is desirable to provide an encoder having an optical comparator for comparing two light signals wherein an interpolated analog signal is provided. In the described encoder, a comparator circuit which provides a linear interpolated signal in response to the comparison of the two light signals, thus the interpolated position of the encoder is obtained. This is accomplished by coupling a transimpedance amplifier having diodes in the feedback circuit to each of the optical detectors and coupling each of the transimpedance amplifiers to bases of a differential pair which have been manufactured on a substrate common to the feedback diodes to carefully match the transfer characteristics thereof.